package com.gitee.wsl.time.schedule.ext

import com.gitee.wsl.ext.base.currentTimeZone
import com.gitee.wsl.time.schedule.cron.CronDateTime
import kotlin.time.Instant
import kotlinx.datetime.toInstant
import kotlinx.datetime.toLocalDateTime
import kotlin.time.ExperimentalTime

internal val anyCronDateTime by lazy {
    CronDateTime()
}
@OptIn(ExperimentalTime::class)
internal fun getAnyNext(relatively: Instant) = anyCronDateTime.toNearDateTime(relatively.toLocalDateTime(currentTimeZone))!!.toInstant(currentTimeZone)
